using System;
using System.Data;
using System.Configuration;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Collections.Generic;
using System.Diagnostics;

namespace VisualDB.Entities
{
    [DebuggerDisplay("Name={Name},Text={Text}")]
    public class DatabaseType
    {
        public const string SQLServer = "SQLServer";
        public const string MySQL = "MySQL";

        [DebuggerBrowsable(DebuggerBrowsableState.Never)]
        private string _name;
        [DebuggerBrowsable(DebuggerBrowsableState.Never)]
        private string _text;

        public DatabaseType(string name, string text)
        {
            _name = name;
            _text = text;
        }

        public string Name
        {
            get
            { 
                return _name;
            }

            set
            {
                _name = value;
            }
        }

        public string Text
        {
            get
            {
                return _text;
            }

            set
            {
                _text = value;
            }
        }

        public static List<DatabaseType> GetDatabaseTypes()
        {
            List<DatabaseType> databaseTypes = new List<DatabaseType>();

            databaseTypes.Add(new DatabaseType(DatabaseType.SQLServer, "SQL Server"));
            databaseTypes.Add(new DatabaseType(DatabaseType.MySQL, "MySQL"));

            return databaseTypes;
        }

        public static DatabaseType GetDatabaseType(string databaseType)
        {
            DatabaseType retVal = null;

            switch (databaseType)
            {
                case DatabaseType.SQLServer:
                    retVal = new DatabaseType(DatabaseType.SQLServer, "SQL Server");
                    break;

                case DatabaseType.MySQL:
                    retVal = new DatabaseType(DatabaseType.MySQL, "MySQL");
                    break;
            }

            return retVal;
        }
    }
}
